package edu.zut2.extends_demo3;

/**
 * 汽车类
 */
public class Vehicle {

    String brand;
    String color;
    double speed;

    public Vehicle() {
    }

    public Vehicle(double speed) {
        this.speed = speed;
    }

    public Vehicle(String brand, String color) {
        this(0.0);
        this.brand = brand;
        this.color = color;
    }

    public Vehicle(String brand, String color,double speed) {
        this.speed = speed;
        this.brand = brand;
        this.color = color;
    }


    public void run() {
        System.out.println(brand + "品牌的汽车正在行驶");
    }

    public final void test(){
        System.out.println("---------------");
    }

    public static void main(String[] args) {
        Vehicle vehicle = new Vehicle("奔驰", "红色");
        vehicle.run();
    }

}
